<?php

use think\facade\Route;

Route::rest([
    'index'   => ['GET', '', 'list'],
    'read' => ['GET', '/:id', 'detail'],
    'save' => ['POST', '', 'add'],
    'update' => ['PUT', '/:id', 'edit'],
    'delete' => ['DELETE', '/:id', 'delete'],
]);

Route::group('admin', function () {
    Route::get('user/select', 'admin.User/select');
})->middleware('check_login', 'admin');

// 用户管理
Route::group('admin', function () {
    Route::resource('user', 'admin.User');

    // 充值余额/积分
    Route::post('user/recharge', 'admin.User/recharge');
    
    // 余额记录
    Route::get('walletLog/money/:id', 'admin.walletLog/money');
    // 积分记录
    Route::get('walletLog/score/:id', 'admin.walletLog/score');
    // 佣金记录
    Route::get('walletLog/commission/:id', 'admin.walletLog/commission');
})->middleware('check_login', 'admin')->middleware('check_rule');
